<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        div{
            border:5px #000 solid;
            border-radius: 5px;
            height: 250px;
        }
        div img{
            float: left;
            width: 100px;
            height: 250px;
            margin-right: 10px;
        }
        div span{
            display: block;
            width: 100px;
            height: 100px;
            font-size: 90px;
            line-height: 100px;
            float: left;
        }
    </style>
</head>
<body>
    <div>
        <img src="" alt="" id="img1">
        <img src="" alt="" id="img2">
        <span>时</span>
        <img src="" alt="" id="img3">
        <img src="" alt="" id="img4">
        <span>分</span>
        <img src="" alt="" id="img5">
        <img src="" alt="" id="img6">
        <span>秒</span>
    </div>
    <script>
           var times=new Date;
        setInterval(function(){
            var times=new Date;
            var hours=times.getHours();
            var m = times.getMinutes();
            var s = times.getSeconds();
            console.log(s);
            
            var timebox=[
                hours<10?0:Math.floor(hours/10),hours%10,
                m<10?0:Math.floor(m/10),m%10,
                s<10?0:Math.floor(s/10),s%10
            ]
            var j= document.getElementsByTagName("img");
            for(var i=0;i<j.length;i++){
              j[i].src="img/"+timebox[i]+".png";
            }
        },1000)
    </script>
</body>
</html>